#include <iostream>

using namespace std;

void rotate(int* nums, int numsSize, int k)
{
    // int m = numsSize+k;
    // int arr[m];
    int arr[4];
    memcpy(arr, nums + (numsSize - k), sizeof(int) * k);
    memcpy(arr + k, nums, sizeof(int) * (numsSize - k));
    for (int i = 0; i < numsSize ; i++)
    {
        nums[i] = arr[i];
    }
}

int main()
{
    int arr[] = {-1,-100,3,99};
    int sz = sizeof(arr) / sizeof(arr[0]);
    rotate(arr, sz, 2);
    for (auto e : arr)
    {
        cout << e <<" ";
    }
    return 0;
}

